<?php
/**
 * Created by PhpStorm.
 * User: Kevin
 * Date: 2019/1/2
 * Time: 11:16
 */
namespace app\factory\controller;
use think\Db;
class Template extends Base
{
    /*
     * 模板列表数据
     */
    public function indexList(){
        if(request()->isAjax ()){
            extract(input());
            $Nowpage = input('page') ? input('page'):1;
            $limits = input("limit")?input("limit"):10;// 获取总条数;
            $count = Db::name('template')->count();
            $lists = Db::name('template')
                ->field(['t_id','t_name','t_path','t_create_time'])
                ->page($Nowpage,$limits)
                ->order('t_create_time desc')
                ->select ();
            return json(['code'=>220,'msg'=>'','count'=>$count,'data'=>$lists]);
        }
        return $this->fetch ('template/index_list');
    }
}